package com.elsa.smart_buffet.service.impl;

import com.elsa.smart_buffet.mapper.DayMpMapper;
import com.elsa.smart_buffet.service.DayMpService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * @ClassName : DayMpServiceImpl  //类名
 * @Author : elsa //作者
 */
@Service
@Slf4j
@Transactional
public class DayMpServiceImpl implements DayMpService {

    @Autowired
    private DayMpMapper dayMpMapper;

    @Override
    public int getDayMpNumByDate(String date) {
        date = date.replace("-", "");
        int num = 0;
        try {
            num = dayMpMapper.getDayMpNumByDate(date);
        } catch (Exception e) {
            log.info(e.getMessage());
        }
        return num;
    }

    @Override
    public int getDayMpNumByMonth(String date) {
        date = date.replace("-", "");
        int num = 0;
        try {
            num = dayMpMapper.getDayMpNumByMonth(date);
        } catch (Exception e) {
            log.info(e.getMessage());
        }
        return num;
    }
}
